@import "~scss/_mixins";

.layoutPreviewWrapper {
    position: absolute; top: 0px; right: 100%; opacity: 0; transition-property: opacity; transition-duration: 0.1s;
	transition-timing-function: linear; height: 100vh; background-color: var(--color-bg-primary); text-align: center; overflow: hidden;
}

.layoutPreviewWrapper.in { opacity: 0; }
.layoutPreviewWrapper.in {
	.layoutPreview { opacity: 0; }
}

.layoutPreviewWrapper.in.show { opacity: 1; }
.layoutPreviewWrapper.in.show {
	.layoutPreview { opacity: 1; }
}

.layoutPreviewWrapper.out { opacity: 0; }
.layoutPreviewWrapper.out {
	.layoutPreview { opacity: 0; }
}

.layoutPreviewWrapper.in.show { opacity: 1; }
.layoutPreviewWrapper.in.show {
	.layoutPreview { opacity: 1; }
}

.layoutPreviewWrapper {
    .layoutPreview { 
		transition: all 0.3s ease-in-out; margin: 0px auto; padding-top: 128px; text-align: left; color: var(--color-text-tertiary); 
		transform-origin: 50% 50%; min-height: 100%;
	}
    .layoutPreview {
        .layoutHeader { margin-bottom: 44px; }
        .titleWrapper { margin-bottom: 8px; }
		.titleWrapper {
			.iconObject { display: inline-block; }
		}
        .title { @include text-title; @include text-overflow-nw; }
        .description { @include text-header3; font-weight: 400; margin-bottom: 10px; }

        .featured { display: flex; align-items: center; gap: 0px 8px; flex-wrap: wrap; }
        .featured {
            .featuredItem { display: flex; align-items: center; gap: 0px 8px; max-width: 220px; }
            .featuredItem {
                .label { @include text-overflow-nw; }
                .bullet { flex-shrink: 0; width: 4px; height: 4px; border-radius: 50%; background: var(--color-text-tertiary); }
            }
            .featuredItem:last-child {
                .bullet { display: none; }
            }
        }
    }

    .layoutPreview.featuredRelationLayoutColumn {
        .featured { flex-direction: column; gap: 10px 0px; padding-top: 36px; }
        .featured {
            dl { width: 100%; display: flex; align-items: center; @include text-overflow-nw; }
            dt { width: 35%; }
			dt {
				.label { width: 100%; @include text-overflow-nw; }
			}

            dd { width: 65%; }
            dd {
                .item { height: 12px; border-radius: 2px; background: var(--color-shape-secondary); }
            }

            dl:nth-child(even) {
                dd {
                    .item { width: 50%; }
                }
            }
        }
    }

    .layoutPreview:not(.isTask) {
        .titleWrapper {
			> .icon { width: 96px; height: 96px; border-radius: 20px; background: var(--color-shape-tertiary) url('~img/icon/sidebar/preview/icon.svg') 50% 50% no-repeat; }
			> .icon, > .iconObject { margin: 0px 0px 20px 0px; }
		}
    }

    .layoutPreview.isTask {
        .titleWrapper { display: flex; align-items: center; justify-content: flex-start; gap: 0px 8px; }
        .titleWrapper > .icon { width: 30px; height: 30px; flex-shrink: 0; }
        .title { @include text-header1; }
    }

    .layoutPreview.align0 {
        .layoutHeader { text-align: left; }
        .featured { justify-content: flex-start; }
    }
    .layoutPreview.align1 {
        .layoutHeader { text-align: center; }
        .titleWrapper,
        .featured { justify-content: center; }
    }
    .layoutPreview.align2 {
        .layoutHeader { text-align: right; }
        .featured { justify-content: flex-end; }
		.titleWrapper { justify-content: flex-start; flex-direction: row-reverse; }
    }

    .layoutPreview.layoutFormatPage {
        .layout { display: flex; flex-direction: column; justify-content: flex-start; gap: 14px 0px; }
        .layout {
            .line { width: 100%; height: 10px; background: var(--color-shape-secondary); }
            .line:last-child { width: 75%; }
        }
    };

    .layoutPreview.layoutFormatList {
        .layoutHeader { text-align: left; }
        .titleWrapper,
        .featured { justify-content: flex-start; }

        .titleWrapper { display: flex; align-items: center; justify-content: flex-start; gap: 0px 8px; }
        .titleWrapper > .icon { width: 32px; height: 32px; background: transparent url('~img/icon/sidebar/preview/iconList.svg'); margin-bottom: 0px; }
        .title { @include text-header1; }

        .listHeader { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px;  }
        .listHeader {
            .left { display: flex; align-items: center; gap: 0px 20px; }
            .left {
                .view { height: 12px; width: 64px; border-radius: 2px; background-color: var(--color-shape-secondary); }
            }
            .right { display: flex; align-items: center; gap: 0px 4px; }
            .right {
                .icon { width: 28px; height: 28px; background-size: 20px; background-position: 50% 50%; background-repeat: no-repeat; }
                .icon.search { background-image: url('~img/icon/dataview/button/search.svg'); }
                .icon.filter { background-image: url('~img/icon/dataview/button/filter0.svg'); }
                .icon.sort { background-image: url('~img/icon/dataview/button/sort0.svg'); }
                .icon.settings { background-image: url('~img/icon/dataview/button/settings.svg'); }

                .buttonPlug { width: 70px; height: 28px; border-radius: 6px; margin-left: 12px; background-color: var(--color-shape-secondary); }
            }
        }
    }

    .layoutPreview.layoutFormatList.defaultViewGrid {
        .listHeader { border-bottom: 1px solid var(--color-shape-secondary); margin-bottom: 39px; }
        .layout { display: flex; flex-direction: column; justify-content: flex-start; gap: 39px 0px; }
        .layout {
            .line { width: 100%; height: 1px; background: var(--color-shape-secondary); }
            .line:last-child { width: 100%; }
        }
    }

    .layoutPreview.layoutFormatList.defaultViewList {
        .listHeader { border-bottom: 1px solid var(--color-shape-secondary); margin-bottom: 22px; }
        .layout { display: flex; flex-direction: column; justify-content: flex-start; gap: 22px 0px; }
        .layout {
            .line { width: 60%; height: 12px; background: var(--color-shape-secondary); }
            .line:nth-child(2),
            .line:nth-child(4) { width: 50%; }
        }
    }

    .layoutPreview.layoutFormatList.defaultViewBoard {
        .listHeader { border-bottom: 1px solid var(--color-shape-secondary); margin-bottom: 14px; }
        .layout { display: flex; justify-content: flex-start; gap: 0px 24px; }
        .layout {
            .group { width: 25%; }
            .group {
                .headerPlug { height: 12px; width: 96px; border-radius: 2px; background-color: var(--color-shape-secondary); margin-bottom: 14px; }
                .item { width: 100%; height: 96px; border: 1px solid var(--color-shape-secondary); opacity: 0.8; border-radius: 8px; margin-bottom: 8px; box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.05); }
            }
        }
    }

    .layoutPreview.layoutFormatList.defaultViewGallery {
        .listHeader { margin-bottom: 2px; }
        .layout { display: flex; gap: 16px; flex-wrap: wrap; }
        .layout {
            .line { width: calc(33% - 9px); height: 96px; border: 1px solid var(--color-shape-secondary); opacity: 0.8; border-radius: 8px; }
        }
    }

    .layoutPreview.layoutFormatList.defaultViewCalendar {
        .listHeader { margin-bottom: 8px; }
        .layout { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--color-shape-secondary);  border-top: 1px solid var(--color-shape-secondary); }
        .layout {
            .day { height: 136px; border-right: 1px solid var(--color-shape-secondary); border-bottom: 1px solid var(--color-shape-secondary); }
        }
    }

    .layoutPreview.isFile {
        .layoutHeader { margin-bottom: 16px; }
        .filePreview { width: 90px; height: 36px; background: var(--color-shape-secondary); border-radius: 6px; margin-bottom: 38px;}

        .fileInfo { display: flex; flex-direction: column; gap: 10px 0px; }
        .fileInfo {
            .title { @include text-paragraph; font-weight: 600; color: var(--color-text-secondary); }

            dl { @include text-common; display: flex; align-items: center; justify-content: space-between; max-width: 284px; flex-wrap: nowrap; }
            dl {
                dt { @include text-overflow-nw; }
                dd { width: 64px; height: 12px; border-radius: 2px; flex-shrink: 0; background: var(--color-shape-secondary); }
            }
        }
    }
}
